import matplotlib.pyplot as plt
import pandas as pd

df = pd.read_excel("d:/dataset/score.xls",header=0)
#
grades = df.iloc[:,[1,2,3]]
print(grades)
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False

plt.figure(figsize=(8,6))

label = ['平时成绩','期末考试成绩','期末综合成绩']

plt.boxplot(grades, notch=True, labels=label, meanline=True)

plt.suptitle("学生成绩分布情况")
plt.savefig('d:/image/task4-23.png')
plt.show()
